package com.company;

import com.company.state.BeforeGameState;
import com.company.state.GameContext;
import com.company.state.PlayingGameState;
import com.company.state.AfterGameState;

/**
 * 状态设计模式测试代码
 */
public class TestForState {

    public static void main(String[] args) {
        //创建篮球比赛上下文
        GameContext gameContext = new GameContext();

        //比赛前状态
        gameContext.setState(new BeforeGameState());

        //比赛进行中状态
        gameContext.setState(new PlayingGameState());

        //比赛后状态
        gameContext.setState(new AfterGameState());
    }
}
